from django.shortcuts import render
from django.http import HttpResponse
from . import models

# Create your views here.
def hello(request):
	content = {}
	content['title'] = '我的第一个页面'
	content['main'] = '随便写点啥吧，这里是内容区域'
	content['list'] = [{'name': '第一个', 'num': 20}, {'name': '第二个', 'num': 10}, {'name': '第三个', 'num': 50} , {'name': '第四个', 'num': 24}]
	return render(request, 'hello.html', content)

def articleList(request):
	articles = models.Article.objects.all()
	return render(request, 'article.html', {'articles': articles})

def articleDetail(request, articel_id):
	article = models.Article.objects.get(pk=articel_id)
	return render(request, '', {'article': article})

